package com.company;

public class Main{

    public static void main(String[] args) {
        System.out.println(10 > 20 && 10 / 0 == 0); // 打印 false
        System.out.println(10 < 20 || 10 / 0 == 0); // 打印 true
    }

    public static void main9(String[] args) {
        int a=10;
        a++;//先使用，后++
        System.out.println(a);//11

        int c=10;
        ++c;//先++，后使用
        System.out.println(c);//11
    }

    public static void main8(String[] args) {
        int a=10;
        a+=1;
        System.out.println(a);

        short s=10;
        s=(short) (s+9);
        s+=9;//自动进行强制类型转换
        System.out.println(s);
    }


    public static void main7(String[] args) {
       // int a = 1;
        //int b = 2;
      //  System.out.println(a/b);
        System.out.println(10%3);//1
        System.out.println(-10%3);//-1
        System.out.println(10%-3);//1
        System.out.println(-10%-3);//-1
    }

    public static void main6(String[] args) {
        String str="123";
        int ret = Integer.valueOf(str);
        System.out.println(ret+1);//字符串转整数
    }

    public static void main5(String[] args) {
        int num=10;
        String ret=String.valueOf(num);
        System.out.println("ret");
        String ret2=num+"";
        System.out.println(ret2);
    }

    public static void main4(String[] args) {
        int a=10;
        byte b=112;

        int i1=10;
        int l1=20;
        int i2=(int)i1+l1;
    }

    public static void main3(String[] args) {
        int a=10;
        long b=a;
        System.out.println(b);

        long l=12;
      //  int c=l;
    }

    public static void main2(String[] args) {
        String str= "hello";
        System.out.println(str);
        System.out.println("hello"+"world");//两个字符串相加代表拼接
        System.out.println("hello"+10+20);//其他数据类型和字符串使用+拼接，结果就是一个字符串
        System.out.println(10+20+"hello");//30hello
        System.out.println(10+""+20+"hello");

        //a=10;
        int b=20;
        System.out.println("a= "+10+", b="+20);
        String s1="\"bit\"";
        System.out.println(s1);
    }


    public static void main1(String[] args) {
	// write your code here
        //System.out.println("Hello");
        //short s = 10;//2字节 十六位    -2^15 -2^15

        boolean flg = true;
        System.out.println(flg);
        boolean flag=false;
    }
}
